﻿using BaBaoFan.Modifier.Data;
using BaBaoFan.Modifier.Model;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BaBaoFan.Modifier.Service
{
    public class AlgorithmInfoService : IAlgorithmInfoService
    {
        IAlgorithmInfoRepository _algorithmRepository;
        public AlgorithmInfoService(IAlgorithmInfoRepository algorithmRepository)
        {
            _algorithmRepository = algorithmRepository;
        }
        public AlgorithmInfoEntity GetById(int id)
        {
            return _algorithmRepository.GetById(id);
        }
        public bool Add(AlgorithmInfoEntity model)
        {
            return _algorithmRepository.Add(model);
        }

        public bool Delete(int[] ids)
        {
            return _algorithmRepository.Delete(ids);
        }

        public IEnumerable<AlgorithmInfo> GetAlgorithmInfos()
        {
            var algorithmInfos = _algorithmRepository.GetAlgorithmInfos();
            return algorithmInfos;
        }

        public bool Update(AlgorithmInfoEntity model)
        {
            return _algorithmRepository.Update(model);
        }

        public IEnumerable<AlgorithmInfo> Search(AlgorithmInfoCondition infoCondition)
        {
           return _algorithmRepository.Search(infoCondition);
        }
    }
}
